<template>
    <div class="mui-numbox" data-numbox-min="1" style="height:25px">
		<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
		<input id="test" class="mui-input-numbox" type="number" :value="num" ref='numbers' @change="changeCt" readonly/>
		<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
	</div>
</template>

<script>
import mui from '../../lib/mui/js/mui.min.js'
export default {
    props:['num','goodsid'],
    methods:{
        changeCt(){
            // 将num同步到store中
            this.$store.commit('updateCar',{
                count : this.$refs.numbers.value,
                id : this.goodsid
            })
        }
    },
    mounted(){  
        mui('.mui-numbox').numbox()
    }
}
</script>

<style lang="less" scoped>
.mui-numbox{
    padding: 0 30px;
    width: 90px;
    .mui-btn{
        width: 30px;
    }
}
</style>